<div class="content">
	<ul class="breadcrumb">
		<li><i class="fa fa-home"></i>
			<li>业务管理</li>
		</li>
		<li>收入统计</li>
	</ul>
	<div class="box">
		<div class="filterForm">
			<ul class="clearfix">
				<li>人员名称：<input type="text" placeholder="请输入人员名称" ng-model="data.staffName"></li>
				<li>客户名称：<input type="text" placeholder="请输入签单人" ng-model="data.realName"></li>
				<li>签单人：<input type="text" placeholder="请输入签单人" ng-model="data.signingPerson"></li>
				<li>开始时间：
					<input type="text" id="startRegDate" style="width:110px" class="startdate" onchange="" onfocus="MyDatePicker()" ng-model="data.serviceStartTime" />
				</li>
				<li>结束时间：
					<input type="text" id="startRegDate" style="width:110px" class="startdate" onchange="" onfocus="MyDatePicker()" ng-model="data.serviceEndTime" />
				</li>
				<li>所属公司：
					<select ng-model="data.instSysId">
							<option value="">全部</option>
							<option ng-repeat="cpItem in instSysList" value="{{cpItem.id}}">{{cpItem.instSysName}}</option>
					</select>
				</li>
				<li>凭证类型：
					<select ng-model="data.proofType">
							<option value="">全部</option>
							<option value="1">收据</option>
							<option value="2">发票</option>
					</select>
				</li>
				<li>凭证号：<input type="text" placeholder="请输入凭证号" ng-model="data.proofNo"></li>
				<li>病区：
					<select ng-model="data.inpatientAreaId" >	
						<option value="">全部</option>
						<option ng-repeat="lesionItem in lesionList" value="{{lesionItem.id}}">{{lesionItem.inpatientArea}}</option>
					</select>
				</li>
				<li>工种：
					<select ng-model="data.workTypeId">
							<option value="">全部</option>
							<option ng-repeat="wtItem in workTypeList" value="{{wtItem.id}}">{{wtItem.workTypeName}}</option>
					</select>
				</li>
				<li><button type="button" class="searchbtn" ng-click="query()" ng-if="ops['O_INCOME_STAT_QUERY']"><i class="fa fa-search"></i>&nbsp查询</button></li>
				<li><button type="button" class="searchbtn" ng-click="reset()"><i class="fa fa-refresh"></i>&nbsp重置</button></li>
				<li><button type="button" class="searchbtn" ng-click="exportReport()" ng-if="ops['O_INCOME_STAT_EXPORT']"><i class="fa fa-search"></i>&nbsp导出</button></li>
			</ul>
		</div>
		<div class="signList">
			
			<table class="tablelist" style="min-width: 2000px;">
				<thead>
					<tr>
						<th class="cell-seq">序号</th>
						<th class="cell-con">订单号</th>
						<th class="cell-seq">客户姓名</th>					
						<th class="cell-seq">签单人</th>
						<th class="cell-number">病区/病床</th>
						<th class="cell-seq">工种</th>
						<th class="cell-seq">护工姓名</th>
						<th class="cell-seq">所属公司</th>
						<th class="cell-seq">凭证类型</th>
						<th class="cell-seq" ng-click="sort('proofNo')">凭证号<i class="fa fa-arrows-v" ></i></th>
						<th class="cell-text" ng-click="sort('serviceStartTime')">开始时间&nbsp<i class="fa fa-arrows-v" ></i></th>
						<th class="cell-text" ng-click="sort('serviceEndTime')">结束时间&nbsp<i class="fa fa-arrows-v" ></i></th>
						<th class="cell-seq">总天数</th>
						<th class="cell-seq">节假日天数</th>
						<th class="cell-seq">订单金额</th>
						<th class="cell-seq">调整金额</th>
						<th class="cell-seq">结算款</th>
						<th class="cell-seq">结算调整</th>
						<th class="cell-seq">管理费</th>
						<th class="cell-con">备注</th>
					</tr>
				</thead>
				<tbody>
					<tr ng-repeat="item in incomeList">
						<td class="cell-seq">{{item.orderNum}}</td>	
						<td class="cell-con">{{item.orderNo}}</td>
						<td class="cell-seq">{{item.realName}}</td>						
						<td class="cell-seq">{{item.signingPerson}}</td>
						<td class="cell-number">{{item.inpatientArea}}/{{item.inpatientWard}}</td>
						<td class="cell-seq">{{item.workTypeName}}</td>
						<td class="cell-seq" ng-click="schedulePopup(item)"><a href="javascript:void(0)">{{item.staffName}}</a></td>
						<td class="cell-seq">{{item.instSysName}}</td>
						<td class="cell-seq">{{item.proofType | proofTypeFilter}}</td>
						<td class="cell-seq">{{item.receiptNo}}{{item.invoiceNo}}</td>
						<td class="cell-text">{{item.serviceStartTime| date:'yyyy-MM-dd HH:mm:ss'}}</td>
						<td class="cell-text">{{item.serviceEndTime| date:'yyyy-MM-dd HH:mm:ss'}}</td>
						<td class="cell-seq">{{item.serviceDuration| number:1}}</td>
						<td class="cell-seq">{{item.holiday| number:1}}</td>
						<td class="cell-seq">{{item.orderAmt+item.orderAdjustAmt| number:2}}</td>
						<td class="cell-seq">{{item.orderAdjustAmt| number:2}}</td>
						<td class="cell-seq">{{item.staffSettleAmt| number:2}}</td>
						<td class="cell-seq">{{item.settleAdjustAmt| number:2}}</td>
						<td class="cell-seq">{{item.instSettleAmt+item.orderAdjustAmt| number:2}}</td>
						<td class="cell-con">{{item.orderRemark}}</td>
					</tr>					
				</tbody>
				<tfoot>
					<tr>
						<td class="cell-seq">合计</td>
						<td class="cell-con"></td>
						<td class="cell-seq"></td>					
						<td class="cell-seq"></td>
						<td class="cell-number"></td>
						<td class="cell-seq"></td>						
						<td class="cell-seq"></td>
						<td class="cell-seq"></td>
						<td class="cell-seq"></td>
						<td class="cell-seq"></td>
						<td class="cell-text"></td>
						<td class="cell-text"></td>
						<td class="cell-seq">{{totalday| number:1}}</td>
						<td class="cell-seq">{{totalHolidayDay| number:1}}</td>
						<td class="cell-seq">{{totalzje| number:2}}</td>
						<td class="cell-seq">{{totalddtz| number:2}}</td>
						<td class="cell-seq">{{totaljsk| number:2}}</td>
						<td class="cell-seq">{{totaljstz| number:2}}</td>
						<td class="cell-seq">{{totalglf| number:2}}</td>
						<td class="cell-con"></td>
					</tr>					
				</tfoot>
			</table>
		</div>
	</div>
</div>
<script type="text/ng-template" id="incomePopup.html"> 
	<div class="content" style="margin:0px;">
		<ul class="breadcrumb">
			<li>
				<i class="fa fa-home"></i>
				<li>业务维护</li>
			</li>
			<li>收入统计</li>
			<li>排班查询</li>
			<i class="fa fa-times" aria-hidden="true" ng-click="close()" style="float: right;font-size: 36px;color: #8aafe4;margin-right: -15px;margin-top: -5px;"></i>
		</ul>
		<div class="box" style="float: left;">
			<div class="filterForm">
				<ul class="clearfix">
					<li><button type="button" class="searchbtn" ng-click="confirm()" ng-if="data.orderStatus==3"><i class="fa fa-check"></i>&nbsp&nbsp批量确认</button></li>
				</ul>
			</div>
			<div class="signList">					
				<table class="tablelist" style="min-width: auto;">
					<thead>
						<tr>							
							<th class="cell-number">人员姓名</th>
							<th class="cell-number">结算调整(元)</th>
							<th class="cell-number">结算款(元)</th>
							<th class="cell-number">排班状态</th>
							<th class="cell-number">排班开始时间</th>
							<th class="cell-number">排班结算时间</th>
						</tr>
					</thead>
					<tbody>
						<tr ng-repeat="item in schList">
							<td class="cell-number">{{item.realName}}</td>
							<td class="cell-number">{{item.settleAdjustAmt | number:2}}</td>
							<td class="cell-number">{{item.staffSettleAmt| number:2}}</td>
							<td class="cell-number">{{item.serviceStatus | SchStateFilter}}</td>
							<td class="cell-number">{{item.serviceStartTime | date:'yyyy-MM-dd HH:mm'}}</td>
							<td class="cell-number">{{item.serviceEndTime | date:'yyyy-MM-dd HH:mm'}}</td>
						</tr>					
					</tbody>
				</table>
			</div>
		</div>
	</div>
</script>